#ifndef _LOGGER_H_
#define _LOGGER_H_
/*
author: Wu Zhen
email: zhen.wu@gameloft.com
version: 1.0.0
*/

#include "Singleton.h"
#include <map>

class Logger : public Singleton<Logger>
{
	typedef std::map<const char*, bool> channel_state_map_t;
private:
	channel_state_map_t _channelState;
public:
	Logger();
	~Logger();
#if defined(WIN32)
	void setChannelActive(const char* channel, bool enable);
	bool isChannelActive(const char* channel) const;
	void log(const char *cur_file, const char *cur_fun, int cur_line, const char* channel, const char *fmt, ...);
#endif
};

#if defined(WIN32)
#define LOG(channel, ...)   Logger::instance()->log(__FILE__, __FUNCTION__, __LINE__, channel, __VA_ARGS__)
#else
#define LOG(channel, ...)  
#endif

#endif
